package com.briup.myblog.dao.ext;

import com.briup.myblog.bean.basic.Article;

import com.briup.myblog.bean.ext.ArticleExt;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface ArticleExtMapper {
    int updateByIdAndStatus(Integer article_id, Integer article_status);

    ArticleExt selectArticleJointById(Integer article_id);

    List<ArticleExt> selectArticleByStatus(int article_status);

    List<ArticleExt> selectAllArticleByPage();

    //标题
    List<ArticleExt> selectAllArticleByTitleAndPage(String article_title);

    //资讯状态
    List<ArticleExt> selectAllArticleByStatusAndPage(Integer article_status);

    //类别的id
    List<ArticleExt> selectAllArticleByCategoryAndPage(Integer category_id);

    //标题加状态
    List<ArticleExt> selectAllArticleByTitleAndStatus(String article_title, Integer article_status);

    //标题加类别id
    List<ArticleExt> selectAllArticleByTitleAndCategory(String article_title, Integer category_id);

    //类别id加状态
    List<ArticleExt> selectAllArticleByCategoryAndStatus(Integer category_id, Integer article_status);

    //标题加类别id加状态
    List<ArticleExt> selectAllArticleByAll(String article_title, Integer category_id, Integer article_status);

    /**
     * 以下为删除栏目功能
     *
     * @param categoryId
     * @return
     */
    //根据栏目id查找资讯
    List<ArticleExt> selectByCategoryId(Integer categoryId);

    void updateReadtimesById(Integer article_id, int read_times);

    void deleteArticleByUserId(int id);

    List<Article> findArticleByUserId(int id);
}